package jp.go.aist.six.test.util.castor.xmlns;

import java.util.ArrayList;
import java.util.Collection;



/**
 * @author  Akihito Nakamura, AIST
 * @version $Id: ContainerClassX.java 172 2010-08-24 06:17:39Z nakamura5akihito $
 */
public class ContainerClassX
{

    private Collection<AbstractClassA>  _elements = new ArrayList<AbstractClassA>();



    /**
     */
    public ContainerClassX()
    {
    }


    /**
     */
    public ContainerClassX(
                    final Collection<? extends AbstractClassA> elements
                    )
    {
        setElement( elements );
    }



    /**
     */
    public boolean addElement(
                    final AbstractClassA element
                    )
    {
        return _elements.add( element );
    }


    public void setElement(
                    final Collection<? extends AbstractClassA> elements
                    )
    {
        if (elements != _elements) {
            _elements.clear();
            if (elements != null  &&  elements.size() > 0) {
                _elements.addAll( elements );
            }
        }
    }


    public Collection<AbstractClassA> getElement()
    {
        return _elements;
    }

}
// ContainerClassX

